<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>LibQQt: zxing::qrcode::MaskUtil Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">LibQQt
   &#160;<span id="projectnumber">v3.1</span>
   </div>
   <div id="projectbrief">开源、跨平台Qt应用程序框架中间件</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>zxing</b></li><li class="navelem"><b>qrcode</b></li><li class="navelem"><a class="el" href="classzxing_1_1qrcode_1_1_mask_util.html">MaskUtil</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="classzxing_1_1qrcode_1_1_mask_util-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">zxing::qrcode::MaskUtil Class Reference</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:aa32c3dfbd0236dc68ef280855a98a6b8"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classzxing_1_1qrcode_1_1_mask_util.html#aa32c3dfbd0236dc68ef280855a98a6b8">applyMaskPenaltyRule1</a> (const <a class="el" href="classzxing_1_1qrcode_1_1_byte_matrix.html">ByteMatrix</a> &amp;matrix)</td></tr>
<tr class="separator:aa32c3dfbd0236dc68ef280855a98a6b8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae3fc0a63e7e43c0400cace1f98770d7c"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classzxing_1_1qrcode_1_1_mask_util.html#ae3fc0a63e7e43c0400cace1f98770d7c">applyMaskPenaltyRule2</a> (const <a class="el" href="classzxing_1_1qrcode_1_1_byte_matrix.html">ByteMatrix</a> &amp;matrix)</td></tr>
<tr class="separator:ae3fc0a63e7e43c0400cace1f98770d7c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abc9c4ac729e26f9d61d8c1ed856477cf"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classzxing_1_1qrcode_1_1_mask_util.html#abc9c4ac729e26f9d61d8c1ed856477cf">applyMaskPenaltyRule3</a> (const <a class="el" href="classzxing_1_1qrcode_1_1_byte_matrix.html">ByteMatrix</a> &amp;matrix)</td></tr>
<tr class="separator:abc9c4ac729e26f9d61d8c1ed856477cf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2224bed0a422e85b78c508983ae9db4c"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classzxing_1_1qrcode_1_1_mask_util.html#a2224bed0a422e85b78c508983ae9db4c">applyMaskPenaltyRule4</a> (const <a class="el" href="classzxing_1_1qrcode_1_1_byte_matrix.html">ByteMatrix</a> &amp;matrix)</td></tr>
<tr class="separator:a2224bed0a422e85b78c508983ae9db4c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab094f1548f9bbb715c7227893da58009"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classzxing_1_1qrcode_1_1_mask_util.html#ab094f1548f9bbb715c7227893da58009">getDataMaskBit</a> (int maskPattern, int x, int y)</td></tr>
<tr class="separator:ab094f1548f9bbb715c7227893da58009"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="aa32c3dfbd0236dc68ef280855a98a6b8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa32c3dfbd0236dc68ef280855a98a6b8">&#9670;&nbsp;</a></span>applyMaskPenaltyRule1()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int zxing::qrcode::MaskUtil::applyMaskPenaltyRule1 </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classzxing_1_1qrcode_1_1_byte_matrix.html">ByteMatrix</a> &amp;&#160;</td>
          <td class="paramname"><em>matrix</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Apply mask penalty rule 1 and return the penalty. Find repetitive cells with the same color and give penalty to them. Example: 00000 or 11111. </p>

</div>
</div>
<a id="ae3fc0a63e7e43c0400cace1f98770d7c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae3fc0a63e7e43c0400cace1f98770d7c">&#9670;&nbsp;</a></span>applyMaskPenaltyRule2()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int zxing::qrcode::MaskUtil::applyMaskPenaltyRule2 </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classzxing_1_1qrcode_1_1_byte_matrix.html">ByteMatrix</a> &amp;&#160;</td>
          <td class="paramname"><em>matrix</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Apply mask penalty rule 2 and return the penalty. Find 2x2 blocks with the same color and give penalty to them. This is actually equivalent to the spec's rule, which is to find MxN blocks and give a penalty proportional to (M-1)x(N-1), because this is the number of 2x2 blocks inside such a block. </p>

</div>
</div>
<a id="abc9c4ac729e26f9d61d8c1ed856477cf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abc9c4ac729e26f9d61d8c1ed856477cf">&#9670;&nbsp;</a></span>applyMaskPenaltyRule3()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int zxing::qrcode::MaskUtil::applyMaskPenaltyRule3 </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classzxing_1_1qrcode_1_1_byte_matrix.html">ByteMatrix</a> &amp;&#160;</td>
          <td class="paramname"><em>matrix</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Apply mask penalty rule 3 and return the penalty. Find consecutive runs of 1:1:3:1:1:4 starting with black, or 4:1:1:3:1:1 starting with white, and give penalty to them. If we find patterns like 000010111010000, we give penalty once. </p>

</div>
</div>
<a id="a2224bed0a422e85b78c508983ae9db4c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2224bed0a422e85b78c508983ae9db4c">&#9670;&nbsp;</a></span>applyMaskPenaltyRule4()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int zxing::qrcode::MaskUtil::applyMaskPenaltyRule4 </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classzxing_1_1qrcode_1_1_byte_matrix.html">ByteMatrix</a> &amp;&#160;</td>
          <td class="paramname"><em>matrix</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Apply mask penalty rule 4 and return the penalty. Calculate the ratio of dark cells and give penalty if the ratio is far from 50%. It gives 10 penalty for 5% distance. </p>

</div>
</div>
<a id="ab094f1548f9bbb715c7227893da58009"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab094f1548f9bbb715c7227893da58009">&#9670;&nbsp;</a></span>getDataMaskBit()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool zxing::qrcode::MaskUtil::getDataMaskBit </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>maskPattern</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>y</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Return the mask bit for "getMaskPattern" at "x" and "y". See 8.8 of JISX0510:2004 for mask pattern conditions. </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>R:/Develop/a0-develop/LibQQt/src/exquisite/qrcode/qrdecode/zxing/zxing/qrcode/encoder/<a class="el" href="_mask_util_8h_source.html">MaskUtil.h</a></li>
<li>R:/Develop/a0-develop/LibQQt/src/exquisite/qrcode/qrdecode/zxing/zxing/qrcode/encoder/MaskUtil.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.14
</small></address>
</body>
</html>
